import request from "@/utils/request";

// 获取医生的医患沟通列表
export function getCommunicateByDoctor(doctorId, pageIndex = 1, pageSize = 10) {
  return request({
    url: `/api/Communicate/listByDoctor/${doctorId}`,
    method: "get",
    params: {
      pageIndex,
      pageSize,
    },
  });
}

// 获取医患沟通详情
export function getCommunicateById(id) {
  return request({
    url: `/api/Communicate/${id}`,
    method: "get",
  });
}

// 更新医患沟通记录
export function updateCommunicate(data) {
  return request({
    url: "/api/Communicate/update",
    method: "put",
    data,
  });
}

// 新增医患沟通记录
export function addCommunicate(data) {
  return request({
    url: "/api/Communicate/add",
    method: "post",
    data,
  });
}

// 删除医患沟通记录
export function deleteCommunicate(id) {
  return request({
    url: `/api/Communicate/${id}`,
    method: "delete",
  });
}
